﻿Imports BUS
Public Class frmxlcapnhatlaydothanhlysach

    Private _malydo As Integer
    Public Property MaLyDo() As Integer
        Get
            Return _malydo
        End Get
        Set(ByVal value As Integer)
            _malydo = value
        End Set
    End Property

    Private Sub SimpleButton_DongY_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimpleButton_DongY.Click
        If TextEdit_TenLyDo.Text <> "" Then
            Dim sql As String = "Update LYDOTHANHLYSACH Set TenLyDoThanhLySach=" + "'" + TextEdit_TenLyDo.Text + "'" + " Where MaLyDoThanhLySach=" + _malydo.ToString()
            Dim bus As New LyDoThanhLySachBUS()
            Dim kq As Integer = bus.CapNhatLyDoThanhLySach(sql)
            If kq = 1 Then
                MessageBox.Show("Câp nhật thành công !")
                Me.Close()
            Else
                MessageBox.Show("Cập nhật thất bại !")
            End If
        Else
            MessageBox.Show("Nhập tên Lý Do!")
        End If
    End Sub
End Class